package com.kodandroid.audit;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.kodandroid.commons.Item;
import com.kodandroid.commons.Seat;
import com.kodandroid.dao.TransactionDAO;

public class Transaction {
	
	private Date time[];
	private List<Item> items;
	private int id;
	private boolean active;
	
	private TransactionDAO transactionDAO;
	
	public Transaction () {
		time = new Date [2];
		//time[0] = <now>
		
		active = true;
		items = new ArrayList<Item>();
		//id = transactionDAO.generateId();
	}
	
	public void endTransaction () {
		active = false;
		//time[1] = <now>
		//transactionDAO.write(this);
	}
	
	public void addItem(Item item) {
		items.add(item);
	}
	
	public void removeItem(Item item) {
		items.remove(item);
	}
	
	public boolean isActive() {
		return active;
	}
	
	public Date[] getTimes() {
		return time;
	}
	
	public int getId() {
		return id;
	}
}
